package com.erlang4j.internal.messages;

import static com.erlang4j.api.Erlang4jMessageLanguage.atom;
import static com.erlang4j.api.Erlang4jMessageLanguage.floating;
import static com.erlang4j.api.Erlang4jMessageLanguage.integer;
import static com.erlang4j.api.Erlang4jMessageLanguage.list;
import static com.erlang4j.api.Erlang4jMessageLanguage.string;
import static com.erlang4j.api.Erlang4jMessageLanguage.tuple;
import junit.framework.TestCase;

import com.ericsson.otp.erlang.OtpErlangAtom;
import com.ericsson.otp.erlang.OtpErlangDouble;
import com.ericsson.otp.erlang.OtpErlangInt;
import com.ericsson.otp.erlang.OtpErlangList;
import com.ericsson.otp.erlang.OtpErlangObject;
import com.ericsson.otp.erlang.OtpErlangString;
import com.ericsson.otp.erlang.OtpErlangTuple;

public class Erlang4JMessageLanguageTest extends TestCase {

	public void testCreationMethods() {
		assertEquals(new OtpErlangInt(1), integer(1));
		assertEquals(new OtpErlangString("1"), string("1"));
		assertEquals(new OtpErlangAtom("1"), atom("1"));
		assertEquals(new OtpErlangDouble(1), floating(1.0));

		assertEquals(new OtpErlangTuple(new OtpErlangObject[] { new OtpErlangInt(1), new OtpErlangString("2") }), tuple(integer(1), string("2")));
		assertEquals(new OtpErlangList(new OtpErlangObject[] { new OtpErlangInt(1), new OtpErlangString("2") }), list(integer(1), string("2")));
	}

}
